|
|
|
|
|
|
|
Save As. Lets the user specify a filename and location in which to save information. |
|
|
|
|
|
|
|
|
Font. Lets the user choose a base font and set any font attributes that are desired. |
|
|
|
|
|
|
|
|
Color. Lets the user choose from a standard color or create a custom color for use in the program. |
|
|
|
|
|
|
|
|
Print. Lets the user select a printer and set some of the printer parameters. |
|
|
|
|
|
|
|
|
Help. Takes the user into the Windows Help system. |
|
|
|
|
|
|
|
|
Although the CommonDialog control is included with Visual Basic, it's not one of the controls included in the Toolbox by default. To access the CommonDialog control, you might first have to add it to your project (and to the Toolbox) by selecting it from the Components dialog box. You can access this dialog box by choosing Project, Components. From there, select Microsoft Common Dialog Control 6.0 in the Controls list and click OK. |
|
|
|
|
|
|
|
|
After you add the CommonDialog control to the Toolbox, you can add the control to a form by clicking the control and drawing it on the form just like any other control. The CommonDialog control appears on your form as an icon, as the control itself is not visible when your application is running. |
|
|
|
|
|
|
|
|
The following sections describe each type of dialog box that can be created with the CommonDialog control. For each of these dialog boxes, you need to set some of the control's properties. You can do so through the Properties window, or you can use the CommonDialog control's Property Pages dialog box. The Property Pages dialog box provides you with easy access to the specific properties that are necessary for each of the common dialog box types (see Figure 7.5). You can access the Property Pages dialog box by clicking the ellipsis ( . . . ) button in the Custom property of the CommonDialog control, or by right-clicking the control and selecting Properties. |
|
|
|
|
|
|
|
|
Figure 7.5
The Property Pages dialog box enables
you to set up the CommonDialog control easily. |
|
|
|
|
|
|
|
|
Testing the CommonDialog Control |
|
|
|
|
|
|
|
|
Throughout this section, you'll want to try each of the styles of common dialog boxes. To get ready to test them, follow these steps: |
|
|
|
|
|
|
|
|
1. Start Visual Basic, if necessary, and begin a new Standard EXE project. |
|
|
|
|
|
|
|
|
2. Select Project, Components from the menu system. |
|
|
|
|
|